.class public Lcom/nemustech/regina/ReginaUpdater;
.super Landroid/app/Activity;
.source "ReginaUpdater.java"


# static fields
.field public static final TAG:Ljava/lang/String; = "ReginaUpdater"


# instance fields
.field private mReceiver:Landroid/content/BroadcastReceiver;

.field public mResult:I

.field private mSelectedRecord:Lcom/nemustech/regina/XMLRecord;

.field private mWarn3gCharge:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 25
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 31
    new-instance v0, Lcom/nemustech/regina/ReginaUpdater$1;

    invoke-direct {v0, p0}, Lcom/nemustech/regina/ReginaUpdater$1;-><init>(Lcom/nemustech/regina/ReginaUpdater;)V

    iput-object v0, p0, Lcom/nemustech/regina/ReginaUpdater;->mReceiver:Landroid/content/BroadcastReceiver;

    return-void
.end method

.method static synthetic access$000(Lcom/nemustech/regina/ReginaUpdater;)Ljava/lang/String;
    .locals 1
    .parameter "x0"

    .prologue
    .line 25
    iget-object v0, p0, Lcom/nemustech/regina/ReginaUpdater;->mWarn3gCharge:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$002(Lcom/nemustech/regina/ReginaUpdater;Ljava/lang/String;)Ljava/lang/String;
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 25
    iput-object p1, p0, Lcom/nemustech/regina/ReginaUpdater;->mWarn3gCharge:Ljava/lang/String;

    return-object p1
.end method

.method static synthetic access$100(Lcom/nemustech/regina/ReginaUpdater;)Lcom/nemustech/regina/XMLRecord;
    .locals 1
    .parameter "x0"

    .prologue
    .line 25
    iget-object v0, p0, Lcom/nemustech/regina/ReginaUpdater;->mSelectedRecord:Lcom/nemustech/regina/XMLRecord;

    return-object v0
.end method


# virtual methods
.method protected isMediaMounted()Z
    .locals 2

    .prologue
    .line 169
    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v0

    .line 170
    .local v0, state:Ljava/lang/String;
    const-string v1, "mounted"

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 172
    const/4 v1, 0x1

    .line 179
    :goto_0
    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method protected onActivityResult(IILandroid/content/Intent;)V
    .locals 1
    .parameter "requestCode"
    .parameter "resultCode"
    .parameter "data"

    .prologue
    .line 147
    sget v0, Lcom/nemustech/regina/UpdaterTask;->PACKAGE_INSTALLATION:I

    if-ne p1, v0, :cond_0

    .line 148
    iget v0, p0, Lcom/nemustech/regina/ReginaUpdater;->mResult:I

    invoke-virtual {p0, v0}, Lcom/nemustech/regina/ReginaUpdater;->setResult(I)V

    .line 149
    invoke-virtual {p0}, Lcom/nemustech/regina/ReginaUpdater;->finish()V

    .line 152
    :cond_0
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 9
    .parameter "savedInstanceState"

    .prologue
    .line 54
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 55
    const v6, 0x7f030012

    invoke-virtual {p0, v6}, Lcom/nemustech/regina/ReginaUpdater;->setContentView(I)V

    .line 56
    const v6, 0x7f07005b

    invoke-virtual {p0, v6}, Lcom/nemustech/regina/ReginaUpdater;->getString(I)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {p0, v6}, Lcom/nemustech/regina/ReginaUpdater;->setTitle(Ljava/lang/CharSequence;)V

    .line 58
    invoke-virtual {p0}, Lcom/nemustech/regina/ReginaUpdater;->getIntent()Landroid/content/Intent;

    move-result-object v6

    invoke-virtual {v6}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v6

    const-string v7, "XMLRECORD"

    invoke-virtual {v6, v7}, Landroid/os/Bundle;->get(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Lcom/nemustech/regina/XMLRecord;

    iput-object v6, p0, Lcom/nemustech/regina/ReginaUpdater;->mSelectedRecord:Lcom/nemustech/regina/XMLRecord;

    .line 60
    const v6, 0x7f090033

    invoke-virtual {p0, v6}, Lcom/nemustech/regina/ReginaUpdater;->findViewById(I)Landroid/view/View;

    move-result-object v3

    check-cast v3, Landroid/widget/ImageView;

    .line 62
    .local v3, iv:Landroid/widget/ImageView;
    :try_start_0
    invoke-virtual {p0}, Lcom/nemustech/regina/ReginaUpdater;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v6

    iget-object v7, p0, Lcom/nemustech/regina/ReginaUpdater;->mSelectedRecord:Lcom/nemustech/regina/XMLRecord;

    invoke-virtual {v7}, Lcom/nemustech/regina/XMLRecord;->getPackageName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Landroid/content/pm/PackageManager;->getApplicationIcon(Ljava/lang/String;)Landroid/graphics/drawable/Drawable;

    move-result-object v6

    invoke-virtual {v3, v6}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V
    :try_end_0
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    .line 69
    :goto_0
    const v6, 0x7f090034

    invoke-virtual {p0, v6}, Lcom/nemustech/regina/ReginaUpdater;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/TextView;

    .line 70
    .local v4, tv:Landroid/widget/TextView;
    iget-object v6, p0, Lcom/nemustech/regina/ReginaUpdater;->mSelectedRecord:Lcom/nemustech/regina/XMLRecord;

    invoke-virtual {v6}, Lcom/nemustech/regina/XMLRecord;->getAppName()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v4, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 72
    const v6, 0x7f090035

    invoke-virtual {p0, v6}, Lcom/nemustech/regina/ReginaUpdater;->findViewById(I)Landroid/view/View;

    move-result-object v4

    .end local v4           #tv:Landroid/widget/TextView;
    check-cast v4, Landroid/widget/TextView;

    .line 73
    .restart local v4       #tv:Landroid/widget/TextView;
    iget-object v6, p0, Lcom/nemustech/regina/ReginaUpdater;->mSelectedRecord:Lcom/nemustech/regina/XMLRecord;

    invoke-virtual {v6}, Lcom/nemustech/regina/XMLRecord;->getServerVersionName()Ljava/lang/String;

    move-result-object v5

    .line 74
    .local v5, version:Ljava/lang/String;
    iget-object v6, p0, Lcom/nemustech/regina/ReginaUpdater;->mSelectedRecord:Lcom/nemustech/regina/XMLRecord;

    invoke-virtual {v6}, Lcom/nemustech/regina/XMLRecord;->getDate()Ljava/lang/String;

    move-result-object v1

    .line 75
    .local v1, date:Ljava/lang/String;
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v6, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, " / "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const/4 v7, 0x0

    const/16 v8, 0xa

    invoke-virtual {v1, v7, v8}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v4, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 77
    const v6, 0x7f090037

    invoke-virtual {p0, v6}, Lcom/nemustech/regina/ReginaUpdater;->findViewById(I)Landroid/view/View;

    move-result-object v4

    .end local v4           #tv:Landroid/widget/TextView;
    check-cast v4, Landroid/widget/TextView;

    .line 78
    .restart local v4       #tv:Landroid/widget/TextView;
    iget-object v6, p0, Lcom/nemustech/regina/ReginaUpdater;->mSelectedRecord:Lcom/nemustech/regina/XMLRecord;

    invoke-virtual {v6}, Lcom/nemustech/regina/XMLRecord;->getChangeLog()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v4, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 80
    const v6, 0x7f09002f

    invoke-virtual {p0, v6}, Lcom/nemustech/regina/ReginaUpdater;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    .line 81
    .local v0, btn:Landroid/widget/Button;
    new-instance v6, Lcom/nemustech/regina/ReginaUpdater$2;

    invoke-direct {v6, p0}, Lcom/nemustech/regina/ReginaUpdater$2;-><init>(Lcom/nemustech/regina/ReginaUpdater;)V

    invoke-virtual {v0, v6}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 133
    const v6, 0x7f090030

    invoke-virtual {p0, v6}, Lcom/nemustech/regina/ReginaUpdater;->findViewById(I)Landroid/view/View;

    move-result-object v0

    .end local v0           #btn:Landroid/widget/Button;
    check-cast v0, Landroid/widget/Button;

    .line 134
    .restart local v0       #btn:Landroid/widget/Button;
    new-instance v6, Lcom/nemustech/regina/ReginaUpdater$3;

    invoke-direct {v6, p0}, Lcom/nemustech/regina/ReginaUpdater$3;-><init>(Lcom/nemustech/regina/ReginaUpdater;)V

    invoke-virtual {v0, v6}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 142
    return-void

    .line 63
    .end local v0           #btn:Landroid/widget/Button;
    .end local v1           #date:Ljava/lang/String;
    .end local v4           #tv:Landroid/widget/TextView;
    .end local v5           #version:Ljava/lang/String;
    :catch_0
    move-exception v6

    move-object v2, v6

    .line 65
    .local v2, e1:Landroid/content/pm/PackageManager$NameNotFoundException;
    invoke-virtual {v2}, Landroid/content/pm/PackageManager$NameNotFoundException;->printStackTrace()V

    .line 66
    invoke-virtual {p0}, Lcom/nemustech/regina/ReginaUpdater;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v6

    invoke-virtual {v6}, Landroid/content/pm/PackageManager;->getDefaultActivityIcon()Landroid/graphics/drawable/Drawable;

    move-result-object v6

    invoke-virtual {v3, v6}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    goto/16 :goto_0
.end method

.method protected onPause()V
    .locals 1

    .prologue
    .line 157
    iget-object v0, p0, Lcom/nemustech/regina/ReginaUpdater;->mReceiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {p0, v0}, Lcom/nemustech/regina/ReginaUpdater;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 158
    invoke-super {p0}, Landroid/app/Activity;->onPause()V

    .line 159
    return-void
.end method

.method protected onResume()V
    .locals 3

    .prologue
    .line 164
    iget-object v0, p0, Lcom/nemustech/regina/ReginaUpdater;->mReceiver:Landroid/content/BroadcastReceiver;

    new-instance v1, Landroid/content/IntentFilter;

    const-string v2, "android.net.conn.CONNECTIVITY_CHANGE"

    invoke-direct {v1, v2}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v0, v1}, Lcom/nemustech/regina/ReginaUpdater;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 165
    invoke-super {p0}, Landroid/app/Activity;->onResume()V

    .line 166
    return-void
.end method
